package camelinaction;

public enum ModuleCMDEnum {
    REGISTER_AND_LOGIN((short) 1, (short) 1, "PLAYER","REGISTER_AND_LOGIN","/chatonline/", "registerAndLogin"),
    LOGIN((short)1, (short)2,"PLAYER", "LOGIN","/chatonline/","login"),
    PUBLIC_CHAT((short)2, (short)1,"CHAT", "PUBLIC_CHAT","/chatonline/","publicChat"),
    PRIVATE_CHAT((short)2, (short)2,"CHAT","PRIVATE_CHAT", "/chatonline/","privateChat"),
    PUSHCHAT((short)2, (short)101,"CHAT", "PUSHCHAT","/chatonline/","pushChat");


    short module;
    short command;
    String modeleName;
    String commandName;
    String fixUrlpath;
    String independantpath;

    ModuleCMDEnum(short module, short command, String modeleName, String commandName, String fixUrlpath, String independantpath) {
        this.module = module;
        this.command = command;
        this.modeleName=modeleName;
        this.commandName=commandName;
        this.fixUrlpath = fixUrlpath;
        this.independantpath=independantpath;

    }


    /*
    * 这个方法需要更换一下，对date，及datetime 2个出现会混淆.目前是统一处理，暂时不用变化，因为这2个最后取的currentFrameWorkNeededDbType，都是一样的。
    * 框架中用到的currentFrameWorkNeededDbType，是第一个字母大写
    * */
    public static ModuleCMDEnum getByModuleandCmd(short module,short command) {
        for (ModuleCMDEnum en : ModuleCMDEnum.values()) {
            if(module==en.module && command==en.command){
                return en;
            }
        }
        return null;
    }
    /*public static String getfullurlPath() {

        return valueOf().fixUrlpath+this.independantpath;
    }*/


}
